package io;

import java.io.Serializable;
import java.util.Arrays;

/*
签名接口
 */
public class Person implements Serializable {
    private String Name;
    private int  age;
    private String gender;
    //被transient关键字修饰的属性序列化时会被忽略,忽略不必要的属性可以达到对象瘦身的目的.
    private transient String[] otherInfor;

    public Person(){}

    public Person( String Name,int  age,String gender ,String[] otherInfor){
        this.age = age;
        this.Name = Name;
        this.gender = gender;
        this.otherInfor = otherInfor;
    }

    @Override
    public String toString() {
        return "Person{" +
                "Name='" + Name + '\'' +
                ", age=" + age +
                ", gender='" + gender + '\'' +
                ", otherInfor=" + Arrays.toString(otherInfor) +
                '}';
    }

    //getter & setter

    public String getName() {
        return Name;
    }

    public void setName(String name) {
        this.Name = name;
    }

    public int getAge() {
        return age;
    }

    public void setAge(int age) {
        this.age = age;
    }

    public String getGender() {
        return gender;
    }

    public void setGender(String gender) {
        this.gender = gender;
    }

    public String[] getOtherInfo() {
        return otherInfor;
    }

    public void setOtherInfo(String[] otherInfo) {
        this.otherInfor = otherInfo;
    }
}
